package ua.simplecoding.kievhome.domain;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;

@Entity
@Table(name = "city")
public class City extends AbstractPrimaryEntity implements Serializable {

    @Column(name = "name")
    private String name;

    @OneToMany(mappedBy = "city", fetch = FetchType.EAGER)
    private List<AppartmentAddress> appointmentAddresses;

    public City(int id) {
        super(id);
    }

    public City() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<AppartmentAddress> getAppointmentAddresses() {
        return appointmentAddresses;
    }

    public void setAppointmentAddresses(List<AppartmentAddress> appointmentAddresses) {
        this.appointmentAddresses = appointmentAddresses;
    }
}
